/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * BaseContainer.java
 *
 * Created on May 18, 2009, 11:11:44 AM
 */

package GUI;

/**
 *
 * @author cs47402_08
 */
public class BaseContainer extends javax.swing.JFrame {

    /** Creates new form BaseContainer */
    public BaseContainer() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        startupPanel1 = new GUI.StartupPanel();
        mainToolbar = new javax.swing.JToolBar();
        startupButton = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JToolBar.Separator();
        sharesButton = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JToolBar.Separator();
        searchButton = new javax.swing.JButton();
        jSeparator3 = new javax.swing.JToolBar.Separator();
        downloadsButton = new javax.swing.JButton();
        browsePanel1 = new GUI.BrowsePanel();
        shareSetupPanel1 = new GUI.ShareSetupPanel();
        searchPanel1 = new GUI.searchPanel();
        MainMenu = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        mainToolbar.setFloatable(false);
        mainToolbar.setRollover(true);

        startupButton.setText("Startup");
        startupButton.setFocusable(false);
        startupButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        startupButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                startupButtonActionPerformed(evt);
            }
        });
        mainToolbar.add(startupButton);
        mainToolbar.add(jSeparator1);

        sharesButton.setText("Share Setup");
        sharesButton.setFocusable(false);
        sharesButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        sharesButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        sharesButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sharesButtonActionPerformed(evt);
            }
        });
        mainToolbar.add(sharesButton);
        mainToolbar.add(jSeparator2);

        searchButton.setText("Search");
        searchButton.setFocusable(false);
        searchButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        searchButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        searchButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchButtonActionPerformed(evt);
            }
        });
        mainToolbar.add(searchButton);
        mainToolbar.add(jSeparator3);

        downloadsButton.setText("Downloads");
        downloadsButton.setFocusable(false);
        downloadsButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        downloadsButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        downloadsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                downloadsButtonActionPerformed(evt);
            }
        });
        mainToolbar.add(downloadsButton);

        browsePanel1.setVisible(false);

        shareSetupPanel1.setVisible(false);

        searchPanel1.setVisible(false);

        jMenu1.setText("File");
        MainMenu.add(jMenu1);

        jMenu2.setText("Edit");
        MainMenu.add(jMenu2);

        setJMenuBar(MainMenu);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(mainToolbar, javax.swing.GroupLayout.PREFERRED_SIZE, 520, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(42, 42, 42)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(searchPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 450, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(startupPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 450, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(browsePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 450, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(shareSetupPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 450, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(searchPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(startupPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(browsePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(shareSetupPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addComponent(mainToolbar, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void downloadsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_downloadsButtonActionPerformed
        startupPanel1.setVisible(false);
        shareSetupPanel1.setVisible(false);
        searchPanel1.setVisible(false);
        browsePanel1.setVisible(true);
        
    }//GEN-LAST:event_downloadsButtonActionPerformed

    private void startupButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startupButtonActionPerformed
        startupPanel1.setVisible(true);
        shareSetupPanel1.setVisible(false);
        searchPanel1.setVisible(false);
        browsePanel1.setVisible(false);
    }//GEN-LAST:event_startupButtonActionPerformed

    private void sharesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sharesButtonActionPerformed
        searchPanel1.setVisible(false);
        startupPanel1.setVisible(false);
        browsePanel1.setVisible(false);
        shareSetupPanel1.setVisible(true);
    }//GEN-LAST:event_sharesButtonActionPerformed

    private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed
         searchPanel1.setVisible(true);
         shareSetupPanel1.setVisible(false);
         startupPanel1.setVisible(false);
         browsePanel1.setVisible(false);
    }//GEN-LAST:event_searchButtonActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new BaseContainer().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuBar MainMenu;
    private GUI.BrowsePanel browsePanel1;
    private javax.swing.JButton downloadsButton;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JToolBar.Separator jSeparator1;
    private javax.swing.JToolBar.Separator jSeparator2;
    private javax.swing.JToolBar.Separator jSeparator3;
    private javax.swing.JToolBar mainToolbar;
    private javax.swing.JButton searchButton;
    private GUI.searchPanel searchPanel1;
    private GUI.ShareSetupPanel shareSetupPanel1;
    private javax.swing.JButton sharesButton;
    private javax.swing.JButton startupButton;
    private GUI.StartupPanel startupPanel1;
    // End of variables declaration//GEN-END:variables

}
